import Vue from 'vue';
import moment from 'moment';
import { isEmpty } from '@/utils/is';

Vue.filter('formatDate', function(value, format = 'YYYY-MM-DD') {
  if (!value) return '-';
  return moment(value).format(format);
});

Vue.filter('formatEmpty', function(value, format = '-') {
  if (isEmpty(value)) return '-';
  return value;
});
